/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package agen.util;

import javax.swing.table.AbstractTableModel;

/**
 *
 * @author juan
 */
public class IndividuoTableModel extends AbstractTableModel {
    private String colname = "Individuo";
    private String[][] data;//estees un comentario para probar el subversion

    public int getRowCount() {
        return data.length ;
    }

    public int getColumnCount() {
        return data[0].length;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        return data[rowIndex][columnIndex];
    }

    @Override
    public void setValueAt(Object ahpCell, int rowIndex, int columnIndex) {
        data[rowIndex][0] = (String) ahpCell;
    }

    @Override
    public String getColumnName(int column) {
        return colname;
    }
    public void setEstructura(int[][] elementos){
        data = new String[elementos.length][1];
        for (int i = 0; i < elementos.length; i++) {
            data[i] = new String[] {"A[" + String.valueOf(elementos[i][0])
                +", " + String.valueOf(elementos[i][1]-1) + "]"};

        }
    }
}
